﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WinformDevelopFrame.Entity
{
    public class TableInfo
    {
        public string TableName { get; set; }
        public string Remark { get; set; }
        public string ColumnName { get; set; }
        public string DataType { get; set; }
        public string FieldType { get; set; }
        public string EXTRA { get; set; }
        public string COLUMN_KEY { get; set; }

        public bool IsIdentity
        {
            get
            {
                if(EXTRA.Equals("auto_increment"))
                    return true;
                return false;
            }
        }
        public bool IsKey
        {
            get
            {
                if (!string.IsNullOrEmpty(COLUMN_KEY)&&(COLUMN_KEY.Equals("PRI")))
                    return true;
                return false;
            }
        }
        /// <summary>
        /// 是否在列表中显示
        /// </summary>
        public bool IsDisplayList { get; set; }
        /// <summary>
        /// 是否在明细中显示
        /// </summary>
        public bool IsDisplayDetail { get; set; }

        /// <summary>
        /// 不可编辑
        /// </summary>
        public bool IsEdit { get; set; }
        /// <summary>
        /// 值字段
        /// </summary>
        public string ValueMember { get; set; }
        /// <summary>
        /// 显示字段
        /// </summary>
        public string DisplayMember { get; set; }
        /// <summary>
        /// 控件name
        /// </summary>
        public string ControlName { get; set; }
        /// <summary>
        /// 控件类型
        /// </summary>
        public string ControlType { get; set; }
        /// <summary>
        /// 是否为搜索列
        /// </summary>
        public bool IsSearch { get; set; }
        /// <summary>
        /// 是否为空校验
        /// </summary>
        public bool IsCheckNull { get; set; }

        /// <summary>
        /// Label名称LabelText
        /// </summary>
        public string LabelName { get; set; }

        /// <summary>
        /// Label名称LabelText
        /// </summary>
        public string LabelText { get; set; }

        /// <summary>
        /// 数据源名称
        /// </summary>
        public string DataSourceName { get; set; }
        /// <summary>
        /// 显示顺序
        /// </summary>
        public int No { get; set; }
        /// <summary>
        /// 分组字段
        /// </summary>
        public string ParentFieldName { get; set; }
        /// <summary>
        /// 默认值/代码
        /// </summary>
        public string DefaultValue { get; set; }


    }
}
